import { ApiProperty } from "@nestjs/swagger";
import {
  IsNumber,
  IsNumberString,
  IsOptional,
  IsString,
  Min,
} from "class-validator";

export class UpdateOrderDto {
  @IsString()
  @ApiProperty({
    required: false,
    description: "客户PO",
  })
  po: string;

  @IsString()
  @ApiProperty({
    required: false,
    description: "客方货号",
  })
  no: string;

  @IsString()
  @ApiProperty({
    required: false,
    description: "备注",
  })
  remark: string;

  /** 键值uuid */
  @IsString()
  @IsOptional()
  @ApiProperty({
    required: false,
    description: "类型",
  })
  type?: string;

  /** 键值uuid */
  @IsString()
  @IsOptional()
  @ApiProperty({
    required: false,
    description: "质量",
  })
  quality?: string;

  @IsString()
  @IsOptional()
  @ApiProperty({
    required: false,
    description: "尺寸",
  })
  size: string;

  @IsNumberString()
  @IsOptional()
  @ApiProperty({
    required: false,
    description: "价格",
  })
  price: string;

  @IsNumber()
  @Min(1)
  @IsOptional()
  @ApiProperty({
    required: false,
    description: "数量",
  })
  quantity: number;
}
